/************************************
	
	BY: 柒码网络出品
	URL: http://www.qimaweb.com/
	TIME: 2015-12-19 17:45
	
************************************/

        //获取数据
        function getData(page){ 
            $.ajax({
                type: 'POST',
                url: '/i/i-newlist.php',
                dataType:'json',
                beforeSend:function(){
                    $("#newlist").append("<div id='loading'><img src='/images/loadinglit.gif' /><br>加载中...</div>");
                },
                success:function(json){
                    $("#newlist").empty();
                    total = json.total; //总记录数
                    pageSize = json.pageSize; //每页显示条数
                    curPage = page; //当前页
                    totalPage = json.totalPage; //总页数
                    var li = "";
                    var list = json.list;
                    $.each(list,function(index,array){ //遍历json数据列
						li += "<li>";
                        li += "<a href='"+array['arcurl']+"' target='_blank'><span class='imgBorder'><div class='video-ui'></div><img src='"+array['litpic']+"' width='196' alt='"+array['title']+"' /></span>";
						li += "<p class='ct'><i class='arc-t'>"+array['title']+"</i></p>";
						li += "<p class='co'><i class='fbl'>"+array['resolution']+"</i><span class='float_r'><i class='dow'>"+array['dows']+"</i></span> </p></a>";
						li += "</li>";
                    });
                    $("#newlist").append(li);
                },
                complete:function(){ //生成分页条
                    getPageBar();
                },
                error:function(){
                    alert("数据加载失败");
                }
            });
        }
        $(function(){
            getData(1);
		});